package com.tongcao.cn.domain;

import org.apache.commons.lang.StringUtils;

import java.beans.Introspector;

/**
 *
 */
public class ReplaceBeanName {

    /**
     * executor后缀
     */
    public static final String EXECUTOR = "Executor";
    /**
     * request后缀
     */
    public static final String REQUEST = "Request";
    /**
     * action后缀
     */
    public static final String ACTION = "Action";
    /**
     * convert后缀
     */
    public static final String CONVERT = "Convert";
    /**
     * Handler后缀
     */
    public static final String HANDLER = "Handler";
    /**
     * Callback后缀
     */
    public static final String CALLBACK = "Callback";


    public static String getName(String source, String target, Class clazz) {
        String clazzName = StringUtils.replace(clazz.getSimpleName(), source, target);
        return Introspector.decapitalize(clazzName);
    }
}
